package cn._51doit.live.jobs;

import org.apache.flink.api.java.utils.ParameterTool;

/**
 * ParameterTool解析参数的例子
 */
public class ParameterToolDemo {

    public static void main(String[] args) throws Exception {
        //fromArgs(args)参数要在main方法中传入，--后面跟属性名，然后跟属性值
        //ParameterTool parameterTool = ParameterTool.fromArgs(args);

        //从指定的文件中读取参数
        ParameterTool parameterTool = ParameterTool.fromPropertiesFile(args[0]);
        String inputTopics = parameterTool.getRequired("kafka.input.topics");
        System.out.println(inputTopics);
        Long checkpointInterval = parameterTool.getLong("checkpoint.interval", 120000);
        System.out.println(checkpointInterval);
        //DataStream<String> lines = FlinkUtils.createKafkaStream();


    }
}
